using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Communication_BroadcastMsg_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Communication.BroadcastMsg);
            args = new Type[]{};
            method = type.GetMethod("Dispose", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Dispose_0);

            field = type.GetField("MsgID", flag);
            app.RegisterCLRFieldGetter(field, get_MsgID_0);
            app.RegisterCLRFieldSetter(field, set_MsgID_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_MsgID_0, AssignFromStack_MsgID_0);
            field = type.GetField("SendTime", flag);
            app.RegisterCLRFieldGetter(field, get_SendTime_1);
            app.RegisterCLRFieldSetter(field, set_SendTime_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_SendTime_1, AssignFromStack_SendTime_1);
            field = type.GetField("SendCount", flag);
            app.RegisterCLRFieldGetter(field, get_SendCount_2);
            app.RegisterCLRFieldSetter(field, set_SendCount_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_SendCount_2, AssignFromStack_SendCount_2);
            field = type.GetField("data", flag);
            app.RegisterCLRFieldGetter(field, get_data_3);
            app.RegisterCLRFieldSetter(field, set_data_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_data_3, AssignFromStack_data_3);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Communication.BroadcastMsg());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Communication.BroadcastMsg[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* Dispose_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Communication.BroadcastMsg instance_of_this_method = (huqiang.Communication.BroadcastMsg)typeof(huqiang.Communication.BroadcastMsg).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Dispose();

            return __ret;
        }


        static object get_MsgID_0(ref object o)
        {
            return ((huqiang.Communication.BroadcastMsg)o).MsgID;
        }

        static StackObject* CopyToStack_MsgID_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.BroadcastMsg)o).MsgID;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_MsgID_0(ref object o, object v)
        {
            ((huqiang.Communication.BroadcastMsg)o).MsgID = (System.UInt16)v;
        }

        static StackObject* AssignFromStack_MsgID_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.UInt16 @MsgID = (ushort)ptr_of_this_method->Value;
            ((huqiang.Communication.BroadcastMsg)o).MsgID = @MsgID;
            return ptr_of_this_method;
        }

        static object get_SendTime_1(ref object o)
        {
            return ((huqiang.Communication.BroadcastMsg)o).SendTime;
        }

        static StackObject* CopyToStack_SendTime_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.BroadcastMsg)o).SendTime;
            __ret->ObjectType = ObjectTypes.Long;
            *(long*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_SendTime_1(ref object o, object v)
        {
            ((huqiang.Communication.BroadcastMsg)o).SendTime = (System.Int64)v;
        }

        static StackObject* AssignFromStack_SendTime_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int64 @SendTime = *(long*)&ptr_of_this_method->Value;
            ((huqiang.Communication.BroadcastMsg)o).SendTime = @SendTime;
            return ptr_of_this_method;
        }

        static object get_SendCount_2(ref object o)
        {
            return ((huqiang.Communication.BroadcastMsg)o).SendCount;
        }

        static StackObject* CopyToStack_SendCount_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.BroadcastMsg)o).SendCount;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_SendCount_2(ref object o, object v)
        {
            ((huqiang.Communication.BroadcastMsg)o).SendCount = (System.Int32)v;
        }

        static StackObject* AssignFromStack_SendCount_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @SendCount = ptr_of_this_method->Value;
            ((huqiang.Communication.BroadcastMsg)o).SendCount = @SendCount;
            return ptr_of_this_method;
        }

        static object get_data_3(ref object o)
        {
            return ((huqiang.Communication.BroadcastMsg)o).data;
        }

        static StackObject* CopyToStack_data_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.BroadcastMsg)o).data;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_data_3(ref object o, object v)
        {
            ((huqiang.Communication.BroadcastMsg)o).data = (System.Byte[][])v;
        }

        static StackObject* AssignFromStack_data_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Byte[][] @data = (System.Byte[][])typeof(System.Byte[][]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Communication.BroadcastMsg)o).data = @data;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Communication.BroadcastMsg();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
